﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Delegate.generated.h"

// 委托

UCLASS()
class XCZ3_API ADelegate : public AActor
{
	GENERATED_BODY()

	DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FLoadMeshDelegate, const FString&, MeshPath);


	UPROPERTY(EditAnywhere, meta=(AllowPrivateAccess=true))
	FString LoadMeshPath;
	
public:

	// BlueprintAssignable 允许在蓝图中绑定事件
	// BlueprintCallable   允许在蓝图中广播事件
	UPROPERTY(BlueprintReadOnly, BlueprintAssignable, BlueprintCallable)
	FLoadMeshDelegate OnLoadMeshDelegate;
	
	ADelegate();
	virtual void BeginPlay() override;
	virtual void Tick(float DeltaTime) override;

	UFUNCTION()
	void OnLoadMesh(const FString& MeshPath);

	UFUNCTION(BlueprintCallable)
	void OnLoadMeshBroadcast();
};
